$.extend($.fn.validatebox.defaults.rules, {
        
        mobile: {
        validator: function (value) {
            var reg = /^1[3|4|5|8|9]\d{9}$/;
            return reg.test(value);
        },
        message: '输入手机号码格式不准确.'
       },
        
        QQ:{
            validator: function (value, param) {
                return /^[1-9]\d{4,10}$/.test(value);
            },
            message: 'QQ号码不正确'
        },
        equalTo: {
            validator: function (value, param) {
            return value== $(param[0]).val();
            },
            message: '两次输入的字符不一至'
        },
        idcard : {
            validator : function(value) {
                return /^\d{15}(\d{2}[A-Za-z0-9])?$/i.test(value);
            },
            message : '身份证号码格式不正确'
        },
        phone : {
        validator : function(value) {
            return /^((\(\d{2,3}\))|(\d{3}\-))?(\(0\d{2,3}\)|0\d{2,3}-)?[1-9]\d{6,7}(\-\d{1,4})?$/i.test(value);
        },
        message : '格式不正确,请使用下面格式:020-88888888'
        },
        integer : {
        validator : function(value) {
            return /^[+]?[0-9]+\d*$/i.test(value);
        },
        message : '请输入数字'
        },
        name: {
        validator: function(value){  
                var flag;
                    $.ajax({
                            type: 'POST', 
                            url: '__APP__/Employe/check_employe_work_id',
                            data:{employe_work_id:value},
                            async:false,
                            success: function(data) {
                                if(data=='ok') {
                                    flag = true;
                                }else{
                                    flag = true;
                                }
                            }
                     });
                  return flag;
            },
           message: '用户名已存在，请更换！'
        },
        oldpassword:{
        validator: function(value){  
                var flag;
                    $.ajax({
                            type: 'POST', 
                            url: '__APP__/User/judgePassword',
                            data:{employe_old_password:value},
                            async:false,
                            success: function(data) {
                                if(data=='ok') {
                                    flag = true;
                                }else{
                                    flag = false;
                                }
                            }
                     });
                  return flag;
            },
           message: '密码错误，请输入正确的密码！'
        }
    });